package com.jincheng.system.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jincheng.common.annotation.Excel;
import com.jincheng.common.core.domain.BaseEntity;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serial;
import java.util.Date;


/**
 * 评论管理对象 tb_comment
 *
 * @author DairyJay
 * @date 2025-03-02
 */
@Setter
@Getter
@TableName("tb_comment")
public class Comment extends BaseEntity {
    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 评论ID（主键，自增）
     */
    private Long commentId;

    /**
     * 活动ID（外键，引用tb_event表的event_id）
     */
    @Excel(name = "活动ID", readConverterExp = "外=键，引用tb_event表的event_id")
    private Long activityId;

    /**
     * 用户ID（外键，引用tb_user表的user_id）
     */
    @Excel(name = "用户ID", readConverterExp = "外=键，引用tb_user表的user_id")
    private Long userId;

    /**
     * 评论内容
     */
    @Excel(name = "评论内容 ")
    private String content;

    /**
     * 点赞数
     */
    @Excel(name = "点赞数")
    private Long likes;

    /**
     * 评论状态
     */
    @Excel(name = "评论状态")
    private Long status;

    /**
     * 逻辑删除
     */
    private Integer delFlag;

    /**
     * 更新者
     */
    @TableField(exist = false)
    @JsonIgnore
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(exist = false)
    @JsonIgnore
    private Date updateTime;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("commentId", getCommentId())
                .append("activityId", getActivityId())
                .append("userId", getUserId())
                .append("content", getContent())
                .append("likes", getLikes())
                .append("status", getStatus())
                .append("delFlag", getDelFlag())
                .append("createTime", getCreateTime())
                .append("createBy", getCreateBy())
                .toString();
    }
}
